package com.we.util;

import java.util.Base64;

/**
 * url编解码工具类
 */
public class Base64Utils {
    /**
     * 编码
     */
    public static String encode(String source){
        return Base64.getEncoder().encodeToString(source.getBytes());
    }

    /**
     * 解码
     */
    public static String decode(String source){
        return new String(Base64.getDecoder().decode(source.getBytes()));
    }
}
